//
//  WeatherTarget.swift
//  MSAPI
//
//  Created by mrsong on 2020/4/15.
//

import Foundation
import MSAPI

enum Weather {
    case weather(cityCode: String)
}

extension Weather: TargetType {
    var baseURL: URL {
        return URL(string: "http://api.help.bj.cn")!
    }
    
    var requestLine: RequestLine {
        switch self {
        case let .weather(cityCode):
            return .init(path: "/apis/weather", parameters: ["id": cityCode], method: .get)
        }
    }
    
    var headers: [String : String]? {
        return nil
    }
}
